#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;

class Solution {
public:
    bool isIsomorphic(string s, string t) {
        int size = s.size();
        map<char,char> M_S;
        map<char,char> M_T;
        for(int i = 0 ;i<size;++i){
            M_S[s[i]] = t[i];
            M_T[t[i]] = s[i];
        }
        string temps = s;
        string tempt = t;
        for(int i = 0;i<size;++i){
            temps[i] = M_S[s[i]];
            tempt[i] = M_T[t[i]];
        }
        if(temps==t&&tempt==s){
            return true;
        }
        else{
            return false;
        }
        
    }
};

int main(){
    Solution S;
    cout<<S.isIsomorphic("ab","ca")<<endl;
}

